import {createStore,combineReducers,applyMiddleware} from 'redux';
import thunk from 'redux-thunk';
import logger from 'redux-logger';

import home from './reducer/home';
import topic from './reducer/topic';
import category from './reducer/category';
import user from './reducer/user';
import adress from './reducer/adress';
import cart from './reducer/cart';
import search from './reducer/search';

const reducers = combineReducers({
    home,
    topic,
    category,
    user,
    adress,
    cart,
    search,
})
const middleware = process.env.NODE_ENV === 'production'? applyMiddleware(thunk) : applyMiddleware(thunk,logger);
export default createStore(reducers,middleware)